package io.renren.modules.efinance.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.efinance.entity.AccountEntity;
import io.renren.modules.efinance.vo.RechargeVo;
import io.renren.modules.efinance.vo.TransferVo;
import io.renren.modules.efinance.vo.WithdrawVo;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.Map;

/**
 *
 *
 * @author lhf
 * @email i@lhf.com
 * @date 2022-06-24 17:18:43
 */
public interface AccountService extends IService<AccountEntity> {

    PageUtils queryPage(Map<String, Object> params);

    @Select("select accountBalance from account where accountName=#{accountName}")
    BigDecimal selectBalance(String accountName);

    void insert(AccountEntity entity);
//    int selectamount(String accountId, String accountRealname);

//    boolean selectpassword(String accountId, String accountRealname,String password);

    void transfer(TransferVo transferVo);

    // 注意里面的余额是要自增加的余额，不是更新后的余额
//    int recharge(AccountEntity accountEntity);
    void recharge(RechargeVo rechargeVo);

    void withdraw(WithdrawVo withdrawVo);
}

